package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.CrmFhdDetailMapper;
import com.ruoyi.quartz.domain.CrmFhdDetail;
import com.ruoyi.quartz.service.ICrmFhdDetailService;

/**
 * 发货单详情Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-14
 */
@Service
public class CrmFhdDetailServiceImpl implements ICrmFhdDetailService 
{
    @Autowired
    private CrmFhdDetailMapper crmFhdDetailMapper;

    /**
     * 查询发货单详情
     * 
     * @param fhNumber 发货单详情主键
     * @return 发货单详情
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public CrmFhdDetail selectCrmFhdDetailByFhNumber(String fhNumber) {
        return crmFhdDetailMapper.selectCrmFhdDetailByFhNumber(fhNumber);
    }

    /**
     * 查询发货单详情列表
     * 
     * @param crmFhdDetail 发货单详情
     * @return 发货单详情
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<CrmFhdDetail> selectCrmFhdDetailList(CrmFhdDetail crmFhdDetail) {
        return crmFhdDetailMapper.selectCrmFhdDetailList(crmFhdDetail);
    }

    /**
     * 新增发货单详情
     * 
     * @param crmFhdDetail 发货单详情
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertCrmFhdDetail(CrmFhdDetail crmFhdDetail) {
        return crmFhdDetailMapper.insertCrmFhdDetail(crmFhdDetail);
    }

    /**
     * 修改发货单详情
     * 
     * @param crmFhdDetail 发货单详情
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateCrmFhdDetail(CrmFhdDetail crmFhdDetail) {
        return crmFhdDetailMapper.updateCrmFhdDetail(crmFhdDetail);
    }

    /**
     * 批量删除发货单详情
     * 
     * @param fhNumbers 需要删除的发货单详情主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteCrmFhdDetailByFhNumbers(String[] fhNumbers) {
        return crmFhdDetailMapper.deleteCrmFhdDetailByFhNumbers(fhNumbers);
    }

    /**
     * 删除发货单详情信息
     * 
     * @param fhNumber 发货单详情主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteCrmFhdDetailByFhNumber(String fhNumber) {
        return crmFhdDetailMapper.deleteCrmFhdDetailByFhNumber(fhNumber);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int clearFhdDetail() {
        return crmFhdDetailMapper.clearFhdDetail();
    }
}
